; 与阶段 02/03 的 compute 函数相同
define i32 @compute(i1 %boost, i32 %value) {
entry:
  %base = call i32 @clamp_non_negative(i32 %value)
  %double = shl i32 %base, 1
  %sel = select i1 %boost, i32 %double, i32 %base
  ret i32 %sel
}

define i32 @clamp_non_negative(i32 %x) {
entry:
  %cmp = icmp slt i32 %x, 0
  %sel = select i1 %cmp, i32 0, i32 %x
  ret i32 %sel
}

define i32 @main() {
entry:
  %call = call i32 @compute(i1 true, i32 -3)
  ret i32 %call
}
